/**
 *@title
 *@author huahuadavids
 *@date 2020/4/12
 */

export default function (actions, dispatch) {
  let newActions = {}
  for (let typeFn in actions) {
    newActions[typeFn] = function () {
      dispatch(
        actions[typeFn].apply(null, arguments)
      )
    }
  }
  return newActions
}